1. Field of the Invention
The present invention relates to the field of caching data streams on a storage media, such as a disk, and more particularly, to a system and method for managing the access of data streams between a storage media and a host.
2. Discussion of the Related Art
Users may access large amounts of data, such as video and audio files, stored on a disk. The data may be read from or written to the disk in data streams. Most known modern disk drives may use caching schemes to improve the perceived performance of accessing and reading the data from the disk. Streams, such as audio and video, may have two main characteristics that separate them from classical storage access schemes. First, data streams may need specific caching to deliver the continuous flow of data on time. A data stream may deliver at, or very close to, a specific instant, as opposed to typical data accesses that are focused on delivery as soon as possible. Second, streaming data is transient in that once accessed, typically, the data may not be accessed again by the same stream. The data is accessed sequentially. Thus, any data that is “before” another block of accessed data may be discarded.
Synchronization and transient access to data may be compromised when multiple streams are involved, for example, when the system records a set of streams from a satellite dish while outputting another stream to a video monitor. In most cases, disturbances in the stream delivery may be handled with sufficiently large buffers. As a general rule, the size of the buffer may be made proportional to the throughput of the stream. The minimum margin of time to avoid hiccoughs is substantially 0.5 seconds, with on the order of 2.0 seconds being recommended in practical instances. The buffers, in turn, may become very large and costly, especially when the number of streams increase.
To guarantee on-time delivery of streaming data, each stream needs a large buffer to smoothen the irregularities of incoming and outgoing flows. One approach to manage multiple streams has been to use a round-robin algorithm to allocate the input/output (“I/O”) streams to their fixed buffers. A buffer manager may assign and read buffers on a rotating basis. The buffers are not managed according to any priority. This approach manages the streams, but may not be optimal in delivering the data streams.
Another approach involves using a priority scheme that allocates I/O data streams according to the status of the buffers. For example, the fuller a read buffer is, the lower its priority may be. The priority approach may be more complicated and harder to program, but it improves the quality of the buffer management. Improvements may include decreased buffer size and the number of simultaneous streams that can be managed. For example, data streams of about 8 Mb/s in a shared environment may need buffers of about 1 MB per stream. If the number of streams approach 5 to 10, then this approach may be unrealistic due to memory constraints.
Thus, these approaches suffer from not allocating buffers according to priority, or having increasing amounts of memory dedicated to buffers. Another shortfall is not utilizing buffer space in an efficient manner. On average, each buffer is about half full, or half empty. The empty space in the buffer is not being utilized for data streaming operations and is useless to global buffering. The extra space may be helpful in handling disturbances, or hiccoughs, in the data stream, but is otherwise mis-allocated. Thus, current approaches to data, stream management may be wasteful, or inefficient.